import axios from "./request";


//注册
function get_register(params = {}) {
    return axios.post('/api/user/register', params)
}
//登录
function get_login(params = {}) {
    return axios.post('/api/user/login', params)
}
//轮播图
function get_swiper(params = {}) {
    return axios.get('/api/index/banner', { params })
}
//导航
function get_nav(params = {}) {
    return axios.get('/api/index/nav', { params })
}
//推荐列表
function get_goodlist(params = {}) {
    return axios.get('/api/index/goodlist', { params })
}
//一级分类
function get_onelist(params = {}) {
    return axios.get('/api/category/list', { params })
}
//二三级分类
function get_subcate(params = {}) {
    return axios.get('/api/category/subcate', { params })
}
//按分类搜索
function get_cate(params = {}) {
    return axios.get('/api/good/list', { params })
}
//按关键词搜索
function get_search(params = {}) {
    return axios.get('/api/good/search', { params })
}
//商品详情
function get_goodinfo(params = {}) {
    return axios.get('/api/good/goodinfo', { params })
}
//商品收藏列表
function get_favlist(params = {}) {
    return axios.get('/api/good/favlist', { params })
}
//商品收藏
function get_fav(params = {}) {
    return axios.post('/api/good/fav', params)
}
//商品取消收藏
function get_unfav(params = {}) {
    return axios.post('/api/good/unfav', params)
}
//购物车列表
function get_cartlist(params = {}) {
    return axios.get('/api/shopcart/list', { params })
}
//购物车清空
function get_clear(params = {}) {
    return axios.post('/api/shopcart/clear',  params )
}
//购物车加
function get_add(params = {}) {
    return axios.post('/api/shopcart/add',  params )
}
//购物车减
function get_sub(params = {}) {
    return axios.post('/api/shopcart/sub',  params )
}

export {
    get_sub,
    get_add,
    get_clear,
    get_cartlist,
    get_unfav,
    get_fav,
    get_favlist,
    get_goodinfo,
    get_search,
    get_register,
    get_login,
    get_swiper,
    get_nav,
    get_goodlist,
    get_cate,
    get_subcate,
    get_onelist,
}